package com.bjsdzk.collector.entity;


/**
 * @Author：cc.
 * @Date：Created in 10:37 2020-05-15
 * @Description：
 */
public enum PoliceDataTypeEnum {
    MANDUNPOLICE34_0("34", "shortCircuit", 151),
    MANDUNPOLICE34_2("34", "overloadAlarm", 213),
    MANDUNPOLICE34_3("34", "temperatureWarning", 216),
    MANDUNPOLICE34_4("34", "leakageAlarm", 63),
    MANDUNPOLICE34_5("34", "OverCurrentAlarm", 155),
    MANDUNPOLICE34_6("34", "overVoltageAlarm", 219),
    MANDUNPOLICE34_11("34", "underVoltageAlarm", 221),
    MANDUNPOLICE34_12("34", "OverVoltageWaring", 220),
    MANDUNPOLICE34_13("34", "underVoltageWaring", 222),
    MANDUNPOLICE34_14("34", "electricLeakageWaring", 212),
    MANDUNPOLICE34_15("34", "currentWarning", 218),
    MANDUNPOLICE34_21("34", "temperatureAlarm", 215),

    MANDUNPOLICE35_0("35", "shortCircuit", 152),
    MANDUNPOLICE35_2("35", "overloadAlarm", 226),
    MANDUNPOLICE35_3("35", "temperatureWarning", 235),
    //    MANDUNPOLICE35_4("35", "leakageAlarm", ),
    MANDUNPOLICE35_5("35", "OverCurrentAlarm", 12),
    MANDUNPOLICE35_6("35", "overVoltageAlarm", 91),
    MANDUNPOLICE35_11("35", "underVoltageAlarm", 92),
    MANDUNPOLICE35_12("35", "OverVoltageWaring", 231),
    MANDUNPOLICE35_13("35", "underVoltageWaring", 233),
    //    MANDUNPOLICE35_14("35", "electricLeakageWaring", ),
    MANDUNPOLICE35_15("35", "currentWarning", 229),
    MANDUNPOLICE35_21("35", "temperatureAlarm", 130),

    MANDUNPOLICE36_0("36", "shortCircuit", 153),
    MANDUNPOLICE36_2("36", "overloadAlarm", 238),
    MANDUNPOLICE36_3("36", "temperatureWarning", 423),
    //    MANDUNPOLICE36_4("36", "leakageAlarm", ),
    MANDUNPOLICE36_5("36", "OverCurrentAlarm", 157),
    MANDUNPOLICE36_6("36", "overVoltageAlarm", 101),
    MANDUNPOLICE36_11("36", "underVoltageAlarm", 102),
    MANDUNPOLICE36_12("36", "OverVoltageWaring", 243),
    MANDUNPOLICE36_13("36", "underVoltageWaring", 245),
    //    MANDUNPOLICE36_14("36", "electricLeakageWaring", ),
    MANDUNPOLICE36_15("36", "currentWarning", 241),
    MANDUNPOLICE36_21("36", "temperatureAlarm", 131),

    MANDUNPOLICE37_0("37", "shortCircuit", 154),
    MANDUNPOLICE37_2("37", "overloadAlarm ", 250),
    MANDUNPOLICE37_3("37", "temperatureWarning", 258),
    //    MANDUNPOLICE37_4("37", "leakageAlarm", ),
    MANDUNPOLICE37_5("37", "OverCurrentAlarm", 158),
    MANDUNPOLICE37_6("37", "overVoltageAlarm", 111),
    MANDUNPOLICE37_11("37", "underVoltageAlarm", 112),
    MANDUNPOLICE37_12("37", "OverVoltageWaring", 254),
    MANDUNPOLICE37_13("37", "underVoltageWaring", 256),
    //    MANDUNPOLICE37_14("37", "electricLeakageWaring", ),
    MANDUNPOLICE37_15("37", "currentWarning", 252),
    MANDUNPOLICE37_21("37", "temperatureAlarm", 132);


    private String type;
    private String item;
    private Integer code;

    PoliceDataTypeEnum(String type, String item, Integer code) {
        this.type = type;
        this.item = item;
        this.code = code;
    }

    public static int getByTypeAndItem(String type, String item) {
        PoliceDataTypeEnum[] values = PoliceDataTypeEnum.values();
        for (PoliceDataTypeEnum value : values) {
            if (value.type.equals(type)
                    && value.item.equals(item)) {
                return value.code;
            }
        }
        return 0;
    }
}
